<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PU2CLR RDA5807 Arduino Library: I2S Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="LOGO.png"/></td>
  <td id="projectalign">
   <div id="projectname">PU2CLR RDA5807 Arduino Library<span id="projectnumber">&#160;1.1.8</span>
   </div>
   <div id="projectbrief">Arduino Library for RDA5807 Devices - By Ricardo Lima Caratti</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group___g_a06.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">I2S Functions</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2070bff9af95a523a77ac304eee7b22f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a06.html#ga2070bff9af95a523a77ac304eee7b22f">RDA5807::setI2SAllParameters</a> (uint8_t R_DELY, uint8_t L_DELY, uint8_t SCLK_O_EDGE, uint8_t SW_O_EDGE, uint8_t I2S_SW_CNT, uint8_t WS_I_EDGE, uint8_t DATA_SIGNED, uint8_t SCLK_I_EDGE, uint8_t WS_LR, uint8_t SLAVE_MASTER, uint8_t OPEN_MODE)</td></tr>
<tr class="memdesc:ga2070bff9af95a523a77ac304eee7b22f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures all parameters for I2S.  <br /></td></tr>
<tr class="separator:ga2070bff9af95a523a77ac304eee7b22f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafe324014c135a510714e7d722f291273"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a06.html#gafe324014c135a510714e7d722f291273">RDA5807::setI2SOn</a> (bool value)</td></tr>
<tr class="memdesc:gafe324014c135a510714e7d722f291273"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables I2S setup.  <br /></td></tr>
<tr class="separator:gafe324014c135a510714e7d722f291273"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70f086ccb3be49c4c51133bae2e8b113"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a06.html#ga70f086ccb3be49c4c51133bae2e8b113">RDA5807::setI2SMaster</a> (bool value)</td></tr>
<tr class="separator:ga70f086ccb3be49c4c51133bae2e8b113"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d5618cd755c0a56fea68ea589bb828f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a06.html#ga3d5618cd755c0a56fea68ea589bb828f">RDA5807::setI2SSpeed</a> (uint8_t value)</td></tr>
<tr class="memdesc:ga3d5618cd755c0a56fea68ea589bb828f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the speed in kbps. You can use the predefined constantes: I2S_WS_STEP_48, I2S_WS_STEP_44_1, I2S_WS_STEP_32,.  <br /></td></tr>
<tr class="separator:ga3d5618cd755c0a56fea68ea589bb828f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabeb9446fc371fe58e075bea7ebc51fdb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a06.html#gabeb9446fc371fe58e075bea7ebc51fdb">RDA5807::setI2SDataSigned</a> (bool value)</td></tr>
<tr class="memdesc:gabeb9446fc371fe58e075bea7ebc51fdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data.  <br /></td></tr>
<tr class="separator:gabeb9446fc371fe58e075bea7ebc51fdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h1><a class="anchor" id="GA06"></a>
I2S</h1>
<p>When setting I2S_ENABLE (register 04) bit is high, the RDA5807FP can get the output signals SCK, WS, SD signals from GPIO3, GPIO1 and GPIO2 (I2S master) </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2070bff9af95a523a77ac304eee7b22f" name="ga2070bff9af95a523a77ac304eee7b22f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2070bff9af95a523a77ac304eee7b22f">&#9670;&#160;</a></span>setI2SAllParameters()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::setI2SAllParameters </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>R_DELY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>L_DELY</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SCLK_O_EDGE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SW_O_EDGE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>I2S_SW_CNT</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>WS_I_EDGE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>DATA_SIGNED</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SCLK_I_EDGE</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>WS_LR</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SLAVE_MASTER</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>OPEN_MODE</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configures all parameters for I2S. </p>
<p>I2S setup must be enabled</p>
<p>I2S_SW_CNT can be: I2S_WS_STEP_48, I2S_WS_STEP_44_1, I2S_WS_STEP_32, I2S_WS_STEP_24, I2S_WS_STEP_22_05, I2S_WS_STEP_16, I2S_WS_STEP_12, I2S_WS_STEP_11_025 or I2S_WS_STEP_8</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">R_DELY</td><td>If 1, R channel data delay 1T </td></tr>
    <tr><td class="paramname">L_DELY</td><td>If 1, L channel data delay 1T </td></tr>
    <tr><td class="paramname">SCLK_O_EDGE</td><td>If 1, invert sclk output when as master </td></tr>
    <tr><td class="paramname">SW_O_EDGE</td><td>If 1, invert ws output when as master </td></tr>
    <tr><td class="paramname">I2S_SW_CNT</td><td>Only valid in master mode. See table above </td></tr>
    <tr><td class="paramname">WS_I_EDGE</td><td>If 0, use normal ws internally; If 1, inverte ws internally </td></tr>
    <tr><td class="paramname">DATA_SIGNED</td><td>If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data. </td></tr>
    <tr><td class="paramname">SCLK_I_EDGE</td><td>If 0, use normal sclk internally;If 1, inverte sclk internally </td></tr>
    <tr><td class="paramname">WS_LR</td><td>Ws relation to l/r channel; If 0, ws=0 -&gt;r, ws=1 -&gt;l; If 1, ws=0 -&gt;l, ws=1 -&gt;r </td></tr>
    <tr><td class="paramname">SLAVE_MASTER</td><td>I2S slave or master; 1 = slave; 0 = master </td></tr>
    <tr><td class="paramname">OPEN_MODE</td><td>Open reserved register mode; 11=open behind registers writing function others: only open behind registers reading function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd>RDA microelectronics RDA5807FP - SINGLE-CHIP BROADCAST FM RADIO TUNER pages 11 and 12</dd>
<dd>
<a class="el" href="group___g_a06.html#gafe324014c135a510714e7d722f291273" title="Enables I2S setup.">setI2SOn</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01386">1386</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
<a id="gafe324014c135a510714e7d722f291273" name="gafe324014c135a510714e7d722f291273"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafe324014c135a510714e7d722f291273">&#9670;&#160;</a></span>setI2SOn()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::setI2SOn </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables I2S setup. </p>
<p>When setting I2S_ENABLE (register 04) bit is high, the RDA5807FP you can get the output signals SCK, WS, SD signals from GPIO3, GPIO1 and GPIO2 (I2S master)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>true or false </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01410">1410</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
<a id="ga70f086ccb3be49c4c51133bae2e8b113" name="ga70f086ccb3be49c4c51133bae2e8b113"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga70f086ccb3be49c4c51133bae2e8b113">&#9670;&#160;</a></span>setI2SMaster()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::setI2SMaster </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>true or false </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01422">1422</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
<a id="ga3d5618cd755c0a56fea68ea589bb828f" name="ga3d5618cd755c0a56fea68ea589bb828f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3d5618cd755c0a56fea68ea589bb828f">&#9670;&#160;</a></span>setI2SSpeed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::setI2SSpeed </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the speed in kbps. You can use the predefined constantes: I2S_WS_STEP_48, I2S_WS_STEP_44_1, I2S_WS_STEP_32,. </p>
<p>/</p>
<p>I2S_WS_STEP_24, I2S_WS_STEP_22_05, I2S_WS_STEP_16, I2S_WS_STEP_12, I2S_WS_STEP_11_025 or I2S_WS_STEP_8</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>value </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01435">1435</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
<a id="gabeb9446fc371fe58e075bea7ebc51fdb" name="gabeb9446fc371fe58e075bea7ebc51fdb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabeb9446fc371fe58e075bea7ebc51fdb">&#9670;&#160;</a></span>setI2SDataSigned()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void RDA5807::setI2SDataSigned </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>If 0, I2S output unsigned 16-bit audio data. If 1, I2S output signed 16-bit audio data. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>true (1) or false (0) </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="_r_d_a5807_8cpp_source.html#l01447">1447</a> of file <a class="el" href="_r_d_a5807_8cpp_source.html">RDA5807.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
